﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/ViewMasterPage1.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<ComputerShopE3.Controllers.TinInfo>>" %> <%--<IEnumerable<ComputerShopE3.Models.TIN_TUC>>--%>
<%@ Import Namespace="ComputerShopE3.Models" %>  
<%@ Import Namespace="System.Collections.Generic" %>  
<%@ Import Namespace="ComputerShopE3.Controllers" %> 

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
	<title>Tin tức</title>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Danh mục tin tức</h2>

   
            <% SiteRoles role = SpiderE3AuthorizeAttribute.GetCurrentRole(Context);
                 %>

    <% foreach (var item in Model) {           
           %>
      <div class = "sp-news-list">      
            <div class = "sp-news-title">
                <%= Html.Encode(item.NgayDang) %>                
            </div>
            <div class = "sp-news-time">
                Đăng bởi&nbsp; <%=Html.Encode(item.Ten)%>
                &nbsp;vào lúc&nbsp; <%=Html.Encode(item.TieuDe)%>
            </div>
            
            <div class = "sp-news-content">
                <%= Html.Encode(item.NoiDung) %>
            </div>
             <div>
            <% if (role == SiteRoles.Admin || role == SiteRoles.Employee)
           { %>
            <%= Html.ActionLink("Chỉnh sửa", "Edit", new { id=item.ID }) %> |
        <% } %>
            </div>
    </div>
    <% } %>
    <p>
        <% if (role == SiteRoles.Admin || role == SiteRoles.Employee)
           { %>
            <%= Html.ActionLink("Tạo mới", "Create")%>
        <% } %>
    </p>

</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="PersonalMenu" runat="server">
</asp:Content>

